﻿<UserControl x:Class="RentsList.RentsListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:cal="http://www.codeplex.com/CompositeWPF"
    xmlns:clr="clr-namespace:RentManagement"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Button HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Margin="10"
                Command="{x:Static clr:RentCommands.ConfirmAllCommand}">Confirm All</Button>

        <StackPanel HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Orientation="Horizontal"
                    Grid.Column="1">
            <TextBlock>Rentals for</TextBlock>
            <TextBlock Text="{Binding SelectedCustomer.Name}" />
        </StackPanel>

        <StackPanel Orientation="Horizontal" Grid.Column="2" VerticalAlignment="Center">
            <TextBlock VerticalAlignment="Center" Margin="10,0,0,0">From:</TextBlock>
            <toolkit:DatePicker  VerticalAlignment="Center" SelectedDate="{Binding FromDate}"/>

            <TextBlock VerticalAlignment="Center" Margin="10,0,0,0">To:</TextBlock>
            <toolkit:DatePicker  VerticalAlignment="Center" SelectedDate="{Binding ToDate}"/>

            <Button Margin="10" Command="{Binding SearchCommand}">Search</Button>
        </StackPanel>


        <ListBox Grid.Row="1" Grid.ColumnSpan="3"
                 cal:RegionManager.RegionName="RentalList">

        </ListBox>
    </Grid>
</UserControl>
